package com.ncase.auto.service.impl;

import java.util.List;
import com.ncase.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ncase.auto.mapper.NcaseApiGroupMapper;
import com.ncase.auto.domain.NcaseApiGroup;
import com.ncase.auto.service.INcaseApiGroupService;

/**
 * 接口分组Service业务层处理
 * 
 * @author zouhuu
 * @date 2025-06-02
 */
@Service
public class NcaseApiGroupServiceImpl implements INcaseApiGroupService 
{
    @Autowired
    private NcaseApiGroupMapper ncaseApiGroupMapper;

    /**
     * 查询接口分组
     * 
     * @param groupId 接口分组主键
     * @return 接口分组
     */
    @Override
    public NcaseApiGroup selectNcaseApiGroupByGroupId(Long groupId)
    {
        return ncaseApiGroupMapper.selectNcaseApiGroupByGroupId(groupId);
    }

    /**
     * 查询接口分组列表
     * 
     * @param ncaseApiGroup 接口分组
     * @return 接口分组
     */
    @Override
    public List<NcaseApiGroup> selectNcaseApiGroupList(NcaseApiGroup ncaseApiGroup)
    {
        return ncaseApiGroupMapper.selectNcaseApiGroupList(ncaseApiGroup);
    }

    /**
     * 新增接口分组
     * 
     * @param ncaseApiGroup 接口分组
     * @return 结果
     */
    @Override
    public int insertNcaseApiGroup(NcaseApiGroup ncaseApiGroup)
    {
        ncaseApiGroup.setCreateTime(DateUtils.getNowDate());
        return ncaseApiGroupMapper.insertNcaseApiGroup(ncaseApiGroup);
    }

    /**
     * 修改接口分组
     * 
     * @param ncaseApiGroup 接口分组
     * @return 结果
     */
    @Override
    public int updateNcaseApiGroup(NcaseApiGroup ncaseApiGroup)
    {
        ncaseApiGroup.setUpdateTime(DateUtils.getNowDate());
        return ncaseApiGroupMapper.updateNcaseApiGroup(ncaseApiGroup);
    }

    /**
     * 批量删除接口分组
     * 
     * @param groupIds 需要删除的接口分组主键
     * @return 结果
     */
    @Override
    public int deleteNcaseApiGroupByGroupIds(Long[] groupIds)
    {
        return ncaseApiGroupMapper.deleteNcaseApiGroupByGroupIds(groupIds);
    }

    /**
     * 删除接口分组信息
     * 
     * @param groupId 接口分组主键
     * @return 结果
     */
    @Override
    public int deleteNcaseApiGroupByGroupId(Long groupId)
    {
        return ncaseApiGroupMapper.deleteNcaseApiGroupByGroupId(groupId);
    }
}
